<template>
    <div class="appmain">
      <div id="WebGL-output"></div>
      <div id="Stats-output"></div>
      <canvas id="mainCanvas" width="600px" height="500px"></canvas>
    </div>
</template>
<script>
export default {
  name: "navbar",
  data() {
    return {};
  },
  components: {},
  watch: {
    $route(to, from) {
    }
  },
  mounted() {
    // 刷新的时候，实现调取，若是放在‘$route’或者是beforeEach里面在点击的时候就会刷新
    if (
      this.$route.path == "/home/appmain" ||
      this.$route.path == "/home/appmainfloor"
    ) {
      initScene();
      renderScene();
      console.log("appmain");
    } else if (
      this.$route.path == "/home/energy" ||
      this.$route.path == "/home/energyfloor"
    ) {
      initScene();
      renderScene();
      setTimeout(() => {
        WebMouseClickEvent("eventClick_001");
      }, 3000);
      console.log("energy");
    } else if (
      this.$route.path == "/home/property" ||
      this.$route.path == "/home/propertyfloor"
    ) {
      initScene();
      renderScene();
      setTimeout(() => {
        WebMouseClickEvent("eventClick_002");
      }, 3000);
    } else if (
      this.$route.path == "/home/operation" ||
      this.$route.path == "/home/operationfloor"
    ) {
      initScene();
      renderScene();
      setTimeout(() => {
        WebMouseClickEvent("eventClick_003");
      }, 3000);
    } else if (
      this.$route.path == "/home/workorder" ||
      this.$route.path == "/home/workorderfloor"
    ) {
      initScene();
      renderScene();
      setTimeout(() => {
        WebMouseClickEvent("eventClick_004");
      }, 3000);
    } else if (
      this.$route.path == "/home/Abnormalvideo" ||
      this.$route.path == "/home/Abnormalvideofloor"
    ) {
      initScene();
      renderScene();
      setTimeout(() => {
        WebMouseClickEvent("eventClick_005");
      }, 3000);
    }
  },
  methods: {}
};
</script>

<style lang="scss" scoped>
$colorwhite: white;
$colorblue: #16cdff;
$bordercolor: #172231;
$borderbottom: #10325d;
$iconcolor: #006fff;
$fontcolor1: #939393;
$fontcolor2: #ffffff;
$fontcolor3: #00a0e9;
.appmain {
  height: 100%;
  width: 100%;
  background-color: khaki;
}
</style>
